package org.nicocube.airain.gwt.client.ui;

import org.nicocube.airain.domain.client.character.ActionType;
import org.nicocube.airain.gwt.client.AirainWeb;
import org.nicocube.airain.gwt.client.ui.item.ItemValued;
import org.nicocube.airain.gwt.client.ui.item.TableHeader;
import org.nicocube.airain.gwt.client.ui.item.TableOfItem;

import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.Widget;

public class ActivitiesLogPanel extends AirainPanel {

	private FlowPanel myPanel;

	public Widget getLabel() {
		return  new Label("Activities Log",false);
	}
	
	public ActivitiesLogPanel(AirainWeb aw) {
		super(aw);
		myPanel = new FlowPanel();

		TableOfItem<ItemValued> activityTable = new TableOfItem<ItemValued>(
				new TableHeader()
				.addCols("Action")
				.addCols("Period")
				.addCols("Result")
		).addRows(
				new ItemValued()
				.setIdent(ActionType.Hunting.toString())
				.addValue("8 - 10")
				.addValue("none")
		).addRows(
				new ItemValued()
				.setIdent(ActionType.Weaponry.toString())
				.addValue("10 - 12")
				.addValue("One javelin built.")
		).addRows(
				new ItemValued()
				.setIdent(ActionType.Eating.toString())
				.addValue("12 - 14")
				.addValue("Yummy")
		).addRows(
				new ItemValued()
				.setIdent(ActionType.Hunting.toString())
				.addValue("14 - 18")
				.addValue("2 prey in the bag.")
		).addRows(
				new ItemValued()
				.setIdent(ActionType.Eating.toString())
				.addValue("18 - 20")
				.addValue("Goooood.")
		).addRows(
				new ItemValued()
				.setIdent(ActionType.Weaponry.toString())
				.addValue("20 - 22")
				.addValue("One javelin built.")
		).addRows(
				new ItemValued()
				.setIdent(ActionType.Sleeping.toString())
				.addValue("22 - 8")
				.addValue("Cuz I worth it.")
		);
		myPanel.add(activityTable.render());
	}

	@Override
	public Panel getPanel() {
		return myPanel;
	}

}
